home *** CD-ROM | disk | FTP | other *** search
- Path: news.ucalgary.ca!news
- From: mvjohnso@acs.ucalgary.ca
- Newsgroups: comp.lang.c++
- Subject: Re: Q: how to handle currency?
- Date: 28 Jan 1996 15:23:04 GMT
- Organization: University of Calgary
- Message-ID: <4eg4co$eos@ds2.acs.ucalgary.ca>
- References: <4e93he$ec@sun.cis.smu.edu>
- Reply-To: mvjohnso@acs.ucalgary.ca
- NNTP-Posting-Host: @ts1-port-6.acs.ucalgary.ca
- X-Newsreader: IBM NewsReader/2 v1.2.5
-
- In <4e93he$ec@sun.cis.smu.edu>, dbowman@post.smu.edu (Damon Bowman) writes:
- >
- >Another beginner question:
- >
- >What data type is used for currency when you want "precision as
- >displayed?" When using the float or double data types, you run into
- >the problem of imprecision. In other words, I want to actually round
- >off my numbers when necessary to create real amounts of EXACTLY 47.23,
- >or whatever the case may be.
- >
- >One of my books suggests that there is a method of doing this with
- >integers, but it does not go into any detail.
- >
- >Any assistance is appreciated.
- >
-
- Look up something called Binary Coded Decimal (BCD), this should answer all
- your questions.
-
- Matt
-